package com.example.taobao;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class GouwuMainActivity5 extends AppCompatActivity {
    private Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gouwu_main5);
        button = findViewById(R.id.but5);

        Bundle bundle = getIntent().getExtras();
        String name = bundle.getString("name");
        String jiage = bundle.getString("jiage");

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                AlertDialog.Builder alert = new AlertDialog.Builder(GouwuMainActivity5.this);
                alert.setIcon(R.drawable.userimage);
                alert.setTitle("付款");
                alert.setMessage(name+jiage);
                alert.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        dialogInterface.dismiss();
                    }
                });
                alert.create().show();
            }
        });
    }
}